All Questions
73 questions
0votes
1answer
706views
Shell scripting, reading a list from tt file, use as variable, use the variable to run python scripts in a foor loop
I am trying to run a shell script where it reads the variables from a txt file, uses that variable in a for loop to run python file. The code reads a txt file where at least there are 100 variable ...
1vote
1answer
706views
Simulating Keystrokes to a Telnet process
On my Linux system I have opened a Telnet session. On the other tab I am running a Python script and giving commands to the Telnet session using mkfifo file redirection. But I am not able to simulate ...
0votes
2answers
95views
Renaming script not working after upgrading. Need a new one
Recursive file renamer - very useful python script stops working after upgrade Python (Pyt2 to Pyt3). Can anyone find and fix the problem please? Thank you! Example, those files: 'Linux příručka ...
0votes
1answer
1kviews
Shell script that prompts user for arguments and inserts them as parameters into a python script
I am trying to write a shell script that prompts the user for 3 case-sensitive arguments username password url and then take those parameters and calls a python script i.e.: "python streamcount....
4votes
3answers
823views
Need to remove files older then 90 days with an exception of last day of the month
Need help in deleting files from unix directory which are older then 90 days, but need to retain files which belongs to end of the month date. (ex: 28th Feb 2022, 31th march, 30th April ) for Ex: I ...
0votes
2answers
185views
How to use mountpoint to verify multiple directories using variables shell/py
if trying to automated this checks, how would py function work with shell def success(): print("### ####end") print("###end") # It can be called when the script fails ...
0votes
4answers
2kviews
Using two variables to form a single text file
I am trying to create a text file with below content user name is ${name} and his mobile number is ${number} I have 10 users and 10 mobile numbers as well. User names are saved in user.txt and the ...
1vote
2answers
2kviews
Running python script many times in a bash file
I want to run a python script many times with various arguments. To do that, I've written the following bash script: requests=(25 50 75 100) factors=(3 6) graphsizes=(25 50 75) for request in "${...
1vote
1answer
1kviews
Recursive (batch) video codec details with MediaInfo CLI
I want to share my script to do this with Media Info CLI and python. At first I tried with pure bash but should have just gone python at first, much quicker and adaptable (for me). My task was to ...
0votes
1answer
856views
Defining linux command in python script and able to run the command from script
I need to write a python script, for example I need to run the command "systemctl is-enabled autofs" and if the output the command is "Failed to get unit file state for autofs.service: ...
0votes
1answer
3kviews
cannot execute python script as sudo from command line
I have a centos 7 VM and I need sudo permissions to run certain shell commands in a python script. I have a #!/usr/bin/env python3.7 at the top of my script and running it as sudo ./script.py gives me ...
1vote
1answer
7kviews
Run a Bash Script from Python and import the exported environment variables into Python
I have the following Bash script called Test_Vars.sh #!/bin/bash #----------------------------------------------------# # Environment Variables being used in the process # #------------------------...
1vote
2answers
25kviews
Start Python script at startup
I have a script that I run with python3 /path/script.py I cannot figure out how to make the script run at startup. Any pointers would be great!
0votes
1answer
1kviews
Redirecting input from a file to a Python script fails but works with pipe
I have this python script: postpycess.py to draw data from a mesh file airfoil.p3d. This script was designed to work with input not using arguments, so I created an input file commands.txt and ...
1vote
1answer
676views
Specify which version of python duplicity should use
I've got a backup script that utilizes duplicity to upload to Dropbox. It's erroring out because the dropbox-python-sdk version required, 6.9.0, uses the keyword async which is now reserved in python3....